<template>
	<view>
		<view class="video-list">
			<view class="video-items">
				<view v-for="(items, index) in cvide" :key="index">
					<view class="video-items-1">
						<view><image class="img" :src="items.coverUrl" mode=""></image></view>
						<view class="title">{{ items.title }}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
import { search_list, search_list_all } from '@/network/https/search.js';
export default {
	props:["videos"],
	data() {
		return {
			cvide: '',
			totalPage: 1, //有几页
			pageSize: 30, //每页几条
			currentPage: 1 //当前页数
		};
	},
	onReachBottom() {
	},
	onLoad(val) {

	},
	created() {
		this.singvideo()
	},
	methods: {
		async singvideo() {
			const parm = {
				keywords:this.videos,
				limit: this.pageSize,
				offset: this.currentPage,
				type: 1014
			};
			const { data: res } = await search_list_all(parm.keywords, parm.limit, parm.offset, parm.type);
			this.currentPage += 10;
			this.video = res.result.videos.slice(0, 5);
			this.cvide = [...this.cvide, ...res.result.videos];
			console.log('mv', res);
		}
	}
};
</script>

<style lang="scss" scoped>
.video-list {
	background-color: #ffffff;
	width: 700rpx;
	box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
	margin: 30rpx auto;
	border-radius: 10rpx;
	padding-bottom: 30rpx;
	.video-items {
		margin-left: 20rpx;
		padding-top: 20rpx;
		&-1 {
			display: flex;
			align-items: center;
			margin-top: 30rpx;
			.img {
				width: 250rpx;
				height: 150rpx;
				border-radius: 23rpx;
			}
			.title {
				margin-left: 30rpx;
				width: 300rpx;
				white-space: normal;
				overflow: hidden;
				display: -webkit-box; //将元素设为盒子伸缩模型显示
				-webkit-box-orient: vertical; //伸缩方向设为垂直方向
				-webkit-line-clamp: 2; //超出3行隐藏，并显示省略号
			}
		}
	}
}
</style>
